//
// CCluster.java
// Copyright (C) 2010  "Naush" <naush _ hotmail _ fr>
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program.  If not, see <http://www.gnu.org/licenses/>./* ----------------------------------------------------------------------------







package org.ryzom.nel.threed;

import org.ryzom.nel.misc.CVector;
import org.ryzom.nel.misc.IStream;

public class CCluster {
  private long swigCPtr;
  protected boolean swigCMemOwn;

  public CCluster(long cPtr, boolean cMemoryOwn) {
    swigCMemOwn = cMemoryOwn;
    swigCPtr = cPtr;
  }

  public static long getCPtr(CCluster obj) {
    return (obj == null) ? 0 : obj.swigCPtr;
  }

  protected void finalize() {
    delete();
  }

  public synchronized void delete() {
    if (swigCPtr != 0) {
      if (swigCMemOwn) {
        swigCMemOwn = false;
        nel3dJNI.delete_CCluster(swigCPtr);
      }
      swigCPtr = 0;
    }
  }

  public static void registerBasic() {
    nel3dJNI.CCluster_registerBasic();
  }

  public CCluster() {
    this(nel3dJNI.new_CCluster(), true);
  }

  public boolean makeVolume(CVector p1, CVector p2, CVector p3) {
    return nel3dJNI.CCluster_makeVolume(swigCPtr, this, CVector.getCPtr(p1), p1, CVector.getCPtr(p2), p2, CVector.getCPtr(p3), p3);
  }

  public void applyMatrix(SWIGTYPE_p_NLMISC__CMatrix m) {
    nel3dJNI.CCluster_applyMatrix(swigCPtr, this, SWIGTYPE_p_NLMISC__CMatrix.getCPtr(m));
  }

  public boolean isIn(CVector p) {
    return nel3dJNI.CCluster_isIn__SWIG_0(swigCPtr, this, CVector.getCPtr(p), p);
  }

  public boolean isIn(SWIGTYPE_p_NLMISC__CAABBox b) {
    return nel3dJNI.CCluster_isIn__SWIG_1(swigCPtr, this, SWIGTYPE_p_NLMISC__CAABBox.getCPtr(b));
  }

  public boolean isIn(CVector center, float size) {
    return nel3dJNI.CCluster_isIn__SWIG_2(swigCPtr, this, CVector.getCPtr(center), center, size);
  }

  public boolean clipSegment(CVector p0, CVector p1) {
    return nel3dJNI.CCluster_clipSegment(swigCPtr, this, CVector.getCPtr(p0), p0, CVector.getCPtr(p1), p1);
  }

  public SWIGTYPE_p_NLMISC__CAABBox getBBox() {
    return new SWIGTYPE_p_NLMISC__CAABBox(nel3dJNI.CCluster_getBBox(swigCPtr, this), false);
  }

  public void resetPortalLinks() {
    nel3dJNI.CCluster_resetPortalLinks(swigCPtr, this);
  }

  public void link(CPortal portal) {
    nel3dJNI.CCluster_link(swigCPtr, this, CPortal.getCPtr(portal), portal);
  }

  public void unlink(CPortal portal) {
    nel3dJNI.CCluster_unlink(swigCPtr, this, CPortal.getCPtr(portal), portal);
  }

  public long getNbPortals() {
    return nel3dJNI.CCluster_getNbPortals(swigCPtr, this);
  }

  public CPortal getPortal(long pos) {
    long cPtr = nel3dJNI.CCluster_getPortal(swigCPtr, this, pos);
    return (cPtr == 0) ? null : new CPortal(cPtr, false);
  }

  public void serial(IStream f) {
    nel3dJNI.CCluster_serial(swigCPtr, this, IStream.getCPtr(f), f);
  }

  public void setWorldMatrix(SWIGTYPE_p_NLMISC__CMatrix WM) {
    nel3dJNI.CCluster_setWorldMatrix(swigCPtr, this, SWIGTYPE_p_NLMISC__CMatrix.getCPtr(WM));
  }

  public boolean isRoot() {
    return nel3dJNI.CCluster_isRoot(swigCPtr, this);
  }

  public void setSoundGroup(String soundGroup) {
    nel3dJNI.CCluster_setSoundGroup__SWIG_0(swigCPtr, this, soundGroup);
  }

  public void setSoundGroup(SWIGTYPE_p_NLMISC__TStringId soundGroupId) {
    nel3dJNI.CCluster_setSoundGroup__SWIG_1(swigCPtr, this, SWIGTYPE_p_NLMISC__TStringId.getCPtr(soundGroupId));
  }

  public String getSoundGroup() {
    return nel3dJNI.CCluster_getSoundGroup(swigCPtr, this);
  }

  public SWIGTYPE_p_NLMISC__TStringId getSoundGroupId() {
    return new SWIGTYPE_p_NLMISC__TStringId(nel3dJNI.CCluster_getSoundGroupId(swigCPtr, this), true);
  }

  public void setEnvironmentFx(String environmentFx) {
    nel3dJNI.CCluster_setEnvironmentFx__SWIG_0(swigCPtr, this, environmentFx);
  }

  public void setEnvironmentFx(SWIGTYPE_p_NLMISC__TStringId environmentFxId) {
    nel3dJNI.CCluster_setEnvironmentFx__SWIG_1(swigCPtr, this, SWIGTYPE_p_NLMISC__TStringId.getCPtr(environmentFxId));
  }

  public String getEnvironmentFx() {
    return nel3dJNI.CCluster_getEnvironmentFx(swigCPtr, this);
  }

  public SWIGTYPE_p_NLMISC__TStringId getEnvironmentFxId() {
    return new SWIGTYPE_p_NLMISC__TStringId(nel3dJNI.CCluster_getEnvironmentFxId(swigCPtr, this), true);
  }

  public void traverseHrc() {
    nel3dJNI.CCluster_traverseHrc(swigCPtr, this);
  }

  public void traverseClip() {
    nel3dJNI.CCluster_traverseClip(swigCPtr, this);
  }

  public boolean clip() {
    return nel3dJNI.CCluster_clip(swigCPtr, this);
  }

  public void setCameraIn(boolean state) {
    nel3dJNI.CCluster_setCameraIn(swigCPtr, this, state);
  }

  public boolean isCameraIn() {
    return nel3dJNI.CCluster_isCameraIn(swigCPtr, this);
  }

  public void recursTraverseClip(CTransform caller) {
    nel3dJNI.CCluster_recursTraverseClip(swigCPtr, this, CTransform.getCPtr(caller), caller);
  }

  public void cameraRayClip(CVector start, CVector end, SWIGTYPE_p_std__vectorT_NL3D__CCluster_p_t clusterVisited) {
    nel3dJNI.CCluster_cameraRayClip(swigCPtr, this, CVector.getCPtr(start), start, CVector.getCPtr(end), end, SWIGTYPE_p_std__vectorT_NL3D__CCluster_p_t.getCPtr(clusterVisited));
  }

  public void setAccelIt(SWIGTYPE_p_CQuadGridT_NL3D__CCluster_p_t__CIterator value) {
    nel3dJNI.CCluster_AccelIt_set(swigCPtr, this, SWIGTYPE_p_CQuadGridT_NL3D__CCluster_p_t__CIterator.getCPtr(value));
  }

  public SWIGTYPE_p_CQuadGridT_NL3D__CCluster_p_t__CIterator getAccelIt() {
    return new SWIGTYPE_p_CQuadGridT_NL3D__CCluster_p_t__CIterator(nel3dJNI.CCluster_AccelIt_get(swigCPtr, this), true);
  }

  public void setName(String value) {
    nel3dJNI.CCluster_Name_set(swigCPtr, this, value);
  }

  public String getName() {
    return nel3dJNI.CCluster_Name_get(swigCPtr, this);
  }

  public void setFatherVisible(boolean value) {
    nel3dJNI.CCluster_FatherVisible_set(swigCPtr, this, value);
  }

  public boolean getFatherVisible() {
    return nel3dJNI.CCluster_FatherVisible_get(swigCPtr, this);
  }

  public void setVisibleFromFather(boolean value) {
    nel3dJNI.CCluster_VisibleFromFather_set(swigCPtr, this, value);
  }

  public boolean getVisibleFromFather() {
    return nel3dJNI.CCluster_VisibleFromFather_get(swigCPtr, this);
  }

  public void setFatherAudible(boolean value) {
    nel3dJNI.CCluster_FatherAudible_set(swigCPtr, this, value);
  }

  public boolean getFatherAudible() {
    return nel3dJNI.CCluster_FatherAudible_get(swigCPtr, this);
  }

  public void setAudibleFromFather(boolean value) {
    nel3dJNI.CCluster_AudibleFromFather_set(swigCPtr, this, value);
  }

  public boolean getAudibleFromFather() {
    return nel3dJNI.CCluster_AudibleFromFather_get(swigCPtr, this);
  }

  public void setFather(CCluster value) {
    nel3dJNI.CCluster_Father_set(swigCPtr, this, CCluster.getCPtr(value), value);
  }

  public CCluster getFather() {
    long cPtr = nel3dJNI.CCluster_Father_get(swigCPtr, this);
    return (cPtr == 0) ? null : new CCluster(cPtr, false);
  }

  public void setChildren(SWIGTYPE_p_std__vectorT_NL3D__CCluster_p_t value) {
    nel3dJNI.CCluster_Children_set(swigCPtr, this, SWIGTYPE_p_std__vectorT_NL3D__CCluster_p_t.getCPtr(value));
  }

  public SWIGTYPE_p_std__vectorT_NL3D__CCluster_p_t getChildren() {
    long cPtr = nel3dJNI.CCluster_Children_get(swigCPtr, this);
    return (cPtr == 0) ? null : new SWIGTYPE_p_std__vectorT_NL3D__CCluster_p_t(cPtr, false);
  }

  public void setGroup(CInstanceGroup value) {
    nel3dJNI.CCluster_Group_set(swigCPtr, this, CInstanceGroup.getCPtr(value), value);
  }

  public CInstanceGroup getGroup() {
    long cPtr = nel3dJNI.CCluster_Group_get(swigCPtr, this);
    return (cPtr == 0) ? null : new CInstanceGroup(cPtr, false);
  }

}
